<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('selisihtgl'))
{
	function selisihTgl($tgl_a,$tgl_b)
	{
		$diff = abs(strtotime($tgl_a) - strtotime($tgl_b)); 
		$years = floor($diff / (365*60*60*24)); 
		$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24)); 
		$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); 
		printf("%d tahun %d bulan %d hari", $years, $months, $days); 
	}
}